import java.util.Arrays;
import java.util.Scanner;

public class SequenceCharacteristics {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x[] = new int[n];
        int sum = 0;
        for (int i = 0 ; i < n ; i++){
            x[i] = sc.nextInt();
            sum += x[i];
        }
        Arrays.sort(x,0,n);
        System.out.println(x[n-1]);
        System.out.println(x[0]);
        System.out.println(sum);
    }
}
